package org.example.web.controller;

import org.example.core.entity.SysUser;
import org.example.system.service.IUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    private static final Logger logger = LoggerFactory.getLogger(UserController.class);

    @Autowired
    private IUserService userService;

    @PostMapping("/list")
    public List<SysUser> list() {
        logger.info("UserController -> list");
        List<SysUser> list = null;
        SysUser user = new SysUser();
        user.setUserId(1L);
        try {
            list = userService.selectUserList(user);
        }catch (ArithmeticException e) {
            e.printStackTrace();
        }
        return list;
    }
}
